<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <script>
        let obj={
            name: "张三",
            age: "18"
        }
        console.log(obj["name"])
        console.log(obj.name)
        console.log(obj.age)

        let obj1=new Object
        obj1.name="李四"
        obj1.age="16"
        console.log(obj1.name)
        console.log(obj1.age)
        
        function Person(){
            this.name= "王五"
            this.age=20
        }
        let p=new Person()
        console.log(p.name)        
        console.log(p.age)

        function Person1(x,y){
            this.name = x
            this.age=y
        }
        let p1=new Person1("赵六",30)
        console.log(p1.name)        
        console.log(p1.age)

        let p2=new Person1("小明",24)
        p2.sayhello=function(a){
            console.log(a)
        }
        p2.sayhello("hi")
        console.log(p2.name,p2.age)
    </script>
</body>
</html>